import React from 'react';
import { Router, Route } from 'dva/router';
import User from './routes/authorities/user';
import UserEdit from './routes/authorities/useredit';
import Department from './routes/basic/department';
import DepartmentEdit from './routes/basic/departmentedit';

import Role from './routes/authorities/role';
import RoleEdit from './routes/authorities/roleedit';

import RoleGroup from './routes/authorities/rolegroup';
import RoleGroupEdit from './routes/authorities/rolegroupedit';

import UserAction from './routes/authorities/useraction';
import UserActionEdit from './routes/authorities/useractionedit';

import UserMenu from './routes/authorities/usermenu';
import UserMenuEdit from './routes/authorities/usermenuedit';
import { onRouteEnter } from './utils/auth';

const routerPartOne = (
    <div>
        <Route path='/user' component={User} onEnter={onRouteEnter}/>
        <Route path='/useredit' component={UserEdit} />
        <Route path='/useredit/:guid' component={UserEdit} />

        <Route path='/department' component={Department} onEnter={onRouteEnter} />
        <Route path='/departmentedit' component={DepartmentEdit} />
        <Route path='/departmentedit/:guid' component={DepartmentEdit} />

        <Route path='/role' component={Role} onEnter={onRouteEnter} />
        <Route path='/roleedit' component={RoleEdit} />
        <Route path='/roleedit/:guid' component={RoleEdit} />

        <Route path='/rolegroup' component={RoleGroup} onEnter={onRouteEnter} />
        <Route path='/rolegroupedit' component={RoleGroupEdit} />
        <Route path='/rolegroupedit/:guid' component={RoleGroupEdit} />

        <Route path='/useraction' component={UserAction} onEnter={onRouteEnter} />
        <Route path='/useractionedit' component={UserActionEdit} />
        <Route path='/useractionedit/:guid' component={UserActionEdit} />

        <Route path='/usermenu' component={UserMenu} onEnter={onRouteEnter} />
        <Route path='/usermenuedit' component={UserMenuEdit} />
        <Route path='/usermenuedit/:guid' component={UserMenuEdit} />
    </div>
)

export default routerPartOne;